package com.starhub.application.rag.enums;

/**
 * 召回检索类型
 * @version: V1.0
 * @author: liuhf
 * @time 2025-06-25
 */
public enum RetrieveEnums {

    EMBEDDING(1, "向量化检索"),
    AGENT(2, "智能体检索");

    private Integer code;

    private String name;

    RetrieveEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }   

    public String getName() {
        return name;
    }

    /**
     * 根据code获取
     * @param code
     * @return
     */
    public static RetrieveEnums getRetrieveEnums(Integer code) {
        if (code == null) {
            return null;
        }
        for (RetrieveEnums retrieve : values()) {
            if (retrieve.getCode().equals(code)) {
                return retrieve;
            }
        }
        return null;
    }
}
